stemgraphic quickstart with numbers

Import stem_graphic from stemgraphic (shortcut) or explicitely from stemgraphic.num.


In [1]:
%matplotlib inline
import pandas as pd
from stemgraphic import stem_graphic

Load a data frame


In [2]:
df = pd.read_csv('../iris.csv')

In [3]:
df.describe()


Out[3]:
sepal_length sepal_width petal_length petal_width
count 150.000000 150.000000 150.000000 150.000000
mean 5.843333 3.054000 3.758667 1.198667
std 0.828066 0.433594 1.764420 0.763161
min 4.300000 2.000000 1.000000 0.100000
25% 5.100000 2.800000 1.600000 0.300000
50% 5.800000 3.000000 4.350000 1.300000
75% 6.400000 3.300000 5.100000 1.800000
max 7.900000 4.400000 6.900000 2.500000

Select a column, or pass the whole dataframe if you want stem_graphic to select the first numerical column.


In [4]:
stem_graphic(df['sepal_length']);